package com.prs.crm.domain.oa;

import java.util.List;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.prs.crm.domain.hr.Person;
import com.prs.crm.domain.oa.CommentChild;
import com.prs.crm.domain.BaseEntity;

/**
 * OA信息发布评论(主)
 * @author zhoupeng 2012-3-21
 *
 */
@Entity
@Table(name="oa_comment")
public class Comment extends BaseEntity{
	private static final long serialVersionUID = 1L;
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Integer id;
	@ManyToOne
	private News news;  //属于新闻
	@ManyToOne
	private NewsReceive newsReceive;
	@ManyToOne
	private PictureNews pictureNews;  //属于图片新闻
	@ManyToOne
	private PictureNewsReceive pictureNewsReceive;
	@ManyToOne
	private Announcement announcement;  //属于公告
	@ManyToOne
	private AnnouncementReceive announcementReceive;
	@ManyToOne
	private Notice notice;  //属于通知
	@ManyToOne
	private NoticeAccept noticeAccept;
	@OneToOne
	private Person person;
	
	@OneToMany(fetch=FetchType.LAZY,mappedBy="comment")
	private List<CommentChild> childs;
	
	public NewsReceive getNewsReceive() {
		return newsReceive;
	}
	public void setNewsReceive(NewsReceive newsReceive) {
		this.newsReceive = newsReceive;
	}
	public PictureNewsReceive getPictureNewsReceive() {
		return pictureNewsReceive;
	}
	public void setPictureNewsReceive(PictureNewsReceive pictureNewsReceive) {
		this.pictureNewsReceive = pictureNewsReceive;
	}
	public AnnouncementReceive getAnnouncementReceive() {
		return announcementReceive;
	}
	public void setAnnouncementReceive(AnnouncementReceive announcementReceive) {
		this.announcementReceive = announcementReceive;
	}
	public NoticeAccept getNoticeAccept() {
		return noticeAccept;
	}
	public void setNoticeAccept(NoticeAccept noticeAccept) {
		this.noticeAccept = noticeAccept;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	
	public News getNews() {
		return news;
	}
	public void setNews(News news) {
		this.news = news;
	}
	public List<CommentChild> getChilds() {
		return childs;
	}
	public void setChilds(List<CommentChild> childs) {
		this.childs = childs;
	}
	public Person getPerson() {
		return person;
	}
	public void setPerson(Person person) {
		this.person = person;
	}
	public PictureNews getPictureNews() {
		return pictureNews;
	}
	public void setPictureNews(PictureNews pictureNews) {
		this.pictureNews = pictureNews;
	}
	public Announcement getAnnouncement() {
		return announcement;
	}
	public void setAnnouncement(Announcement announcement) {
		this.announcement = announcement;
	}
	public Notice getNotice() {
		return notice;
	}
	public void setNotice(Notice notice) {
		this.notice = notice;
	}
	
}
